﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AgCIM.Tools.SpatialEncoding.Beidou
{
    public class BeidouLevel
    {
        private int m_levelIndex;
        private double m_longitudeSplit;
        private double m_latitudeSplit;

        public BeidouLevel(int index, (double, double) meshArray)
        {
            LevelIndex = index;
            LongitudeSplit = meshArray.Item1;
            LatitudeSplit = meshArray.Item2;
        }

        public int LevelIndex { get => m_levelIndex; set => m_levelIndex = value; }
        public double LongitudeSplit { get => m_longitudeSplit; set => m_longitudeSplit = value; }
        public double LatitudeSplit { get => m_latitudeSplit; set => m_latitudeSplit = value; }

        /// <summary>
        /// 北斗编码获取x,y值
        /// </summary>
        /// <param name="index">对应索引 0 1</param>
        /// <returns></returns>
        public double GetSplit(int index)
        {
            return index == 0 ? LongitudeSplit : LatitudeSplit;
        }
    }
}
